import http from "@/common/http/request";
import { songCategoryAddInterface, songCategoryListInterface, songCategoryUpdateInterface } from "./songCategory.interface";

// 分类列表
export const $songCategoryList = (data: songCategoryListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/piano/songCategory/list',
    data,
  })
}

//歌曲分类树
export const $songCategoryListTree = () => {
  const $http = new http();
  return $http.get({
    url: '/piano/songCategory/listTree',
  })
}

//新增分类
export const $songCategoryAdd = (data: songCategoryAddInterface) => {
  const $http = new http();
  return $http.post({
    url: '/piano/songCategory',
    data,
  })
}

//删除分类
export const $songCategoryDelete = (data: Array<string>) => {
  const $http = new http();
  return $http.delete({
    url: `/piano/songCategory/${data.join(',')}`,
  })
}

//更新分类
export const $songCategoryUpdate = (data: songCategoryUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: '/piano/songCategory',
    data,
  })
}

//分类详情
export const $songCategoryDetail = (data: string) => {
  const $http = new http();
  return $http.get({
    url: `/piano/songCategory/${data}`,
  })
}

